clear all
cap log close
set more off

// Define subdirectory locations ----------
global code = "${proj}/code"
global data = "${proj}/data"
global est  = "${proj}/estimates"
global out  = "${proj}/output"
global temp = "${proj}/_temp"
global log  = "${proj}/logs"
// ---------------------------------------

* initialize log file -------------------
log using "${log}/04-extrap_base.log", text replace 

* run subprograms: extrapolation -------------
do "${code}/extrap_base/01-data_extrap.do" 
rscript using "${code}/extrap_base/02-outcomes_q2.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/03-outcomes_b5.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/04-recid_poly.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/05-recid_bins.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/06-recid_pscore.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/07-recid_troop.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/08-recid_county.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/09-recid_spc.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/10-recid_cov.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/11-recid_addcov.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/12-speeds_q2.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/13-speeds_b5.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/14-adjust_q2.R", args("${proj}" "${rlib}")
rscript using "${code}/extrap_base/15-adjust_q2_drop.R", args("${proj}" "${rlib}")
do "${code}/extrap_base/16-optimal_bins.do"
do "${code}/extrap_base/17-optimal_fixed.do"
do "${code}/extrap_base/18-output_outcomes.do"
do "${code}/extrap_base/19-output_main.do"
do "${code}/extrap_base/20-output_fform.do"
do "${code}/extrap_base/21-output_groups.do"
do "${code}/extrap_base/22-output_optimal.do"
do "${code}/extrap_base/23-output_speeds.do"
do "${code}/extrap_base/24-output_adjust.do"

* end log file ---------------------------------------
log close    




